<template>
    <span>
        <button @click="subCount">-</button>
        <span>{{ msg }}</span>
        <button @click="addCount">+</button>
        
    </span>
</template>

<script>
    export default {

    // eslint-disable-next-line vue/multi-word-component-names
    name: "Counter",
    props: ["msg", "index"],

    methods: {
        subCount: function() {
            this.$emit("subCount", this.index)
        },
        addCount: function() {
            this.$emit("addCount", this.index)
        },
    }   
}
</script>

<style>

</style>